<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/boost/iterator/transform_iterator.hpp</title>
  <link rel="stylesheet" type="text/css" href="../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../index.html">top level</a> - <a href="index.html">usr/include/boost/iterator</a> - transform_iterator.hpp<span style="font-size: 80%;"> (source / <a href="transform_iterator.hpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntryHi">100.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:50:33</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntryHi">-</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : // (C) Copyright David Abrahams 2002.</a>
<span class="lineNum">       2 </span>            : // (C) Copyright Jeremy Siek    2002.
<span class="lineNum">       3 </span>            : // (C) Copyright Thomas Witt    2002.
<span class="lineNum">       4 </span>            : // Distributed under the Boost Software License, Version 1.0. (See
<span class="lineNum">       5 </span>            : // accompanying file LICENSE_1_0.txt or copy at
<span class="lineNum">       6 </span>            : // http://www.boost.org/LICENSE_1_0.txt)
<span class="lineNum">       7 </span>            : #ifndef BOOST_TRANSFORM_ITERATOR_23022003THW_HPP
<span class="lineNum">       8 </span>            : #define BOOST_TRANSFORM_ITERATOR_23022003THW_HPP
<span class="lineNum">       9 </span>            : 
<span class="lineNum">      10 </span>            : #include &lt;boost/iterator.hpp&gt;
<span class="lineNum">      11 </span>            : #include &lt;boost/iterator/detail/enable_if.hpp&gt;
<span class="lineNum">      12 </span>            : #include &lt;boost/iterator/iterator_adaptor.hpp&gt;
<span class="lineNum">      13 </span>            : #include &lt;boost/iterator/iterator_categories.hpp&gt;
<span class="lineNum">      14 </span>            : #include &lt;boost/mpl/not.hpp&gt;
<span class="lineNum">      15 </span>            : #include &lt;boost/mpl/bool.hpp&gt;
<span class="lineNum">      16 </span>            : #include &lt;boost/type_traits/function_traits.hpp&gt;
<span class="lineNum">      17 </span>            : #include &lt;boost/type_traits/is_const.hpp&gt;
<span class="lineNum">      18 </span>            : #include &lt;boost/type_traits/is_class.hpp&gt;
<span class="lineNum">      19 </span>            : #include &lt;boost/type_traits/is_function.hpp&gt;
<span class="lineNum">      20 </span>            : #include &lt;boost/type_traits/is_reference.hpp&gt;
<span class="lineNum">      21 </span>            : #include &lt;boost/type_traits/remove_const.hpp&gt;
<span class="lineNum">      22 </span>            : #include &lt;boost/type_traits/remove_reference.hpp&gt;
<span class="lineNum">      23 </span>            : #include &lt;boost/utility/result_of.hpp&gt;
<span class="lineNum">      24 </span>            : 
<span class="lineNum">      25 </span>            : 
<span class="lineNum">      26 </span>            : #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310))
<span class="lineNum">      27 </span>            : # include &lt;boost/type_traits/is_base_and_derived.hpp&gt;
<span class="lineNum">      28 </span>            : 
<span class="lineNum">      29 </span>            : #endif
<span class="lineNum">      30 </span>            : #include &lt;boost/iterator/detail/config_def.hpp&gt;
<span class="lineNum">      31 </span>            : 
<span class="lineNum">      32 </span>            : 
<span class="lineNum">      33 </span>            : namespace boost {
<span class="lineNum">      34 </span>            : namespace iterators {
<span class="lineNum">      35 </span>            : 
<span class="lineNum">      36 </span>            :   template &lt;class UnaryFunction, class Iterator, class Reference = use_default, class Value = use_default&gt;
<span class="lineNum">      37 </span>            :   class transform_iterator;
<span class="lineNum">      38 </span>            : 
<span class="lineNum">      39 </span>            :   namespace detail
<span class="lineNum">      40 </span>            :   {
<span class="lineNum">      41 </span>            :     // Compute the iterator_adaptor instantiation to be used for transform_iterator
<span class="lineNum">      42 </span>            :     template &lt;class UnaryFunc, class Iterator, class Reference, class Value&gt;
<span class="lineNum">      43 </span>            :     struct transform_iterator_base
<span class="lineNum">      44 </span>            :     {
<span class="lineNum">      45 </span>            :      private:
<span class="lineNum">      46 </span>            :         // By default, dereferencing the iterator yields the same as
<span class="lineNum">      47 </span>            :         // the function.
<span class="lineNum">      48 </span>            :         typedef typename ia_dflt_help&lt;
<span class="lineNum">      49 </span>            :             Reference
<span class="lineNum">      50 </span>            :           , result_of&lt;const UnaryFunc(typename std::iterator_traits&lt;Iterator&gt;::reference)&gt;
<span class="lineNum">      51 </span>            :         &gt;::type reference;
<span class="lineNum">      52 </span>            : 
<span class="lineNum">      53 </span>            :         // To get the default for Value: remove any reference on the
<span class="lineNum">      54 </span>            :         // result type, but retain any constness to signal
<span class="lineNum">      55 </span>            :         // non-writability.  Note that if we adopt Thomas' suggestion
<span class="lineNum">      56 </span>            :         // to key non-writability *only* on the Reference argument,
<span class="lineNum">      57 </span>            :         // we'd need to strip constness here as well.
<span class="lineNum">      58 </span>            :         typedef typename ia_dflt_help&lt;
<span class="lineNum">      59 </span>            :             Value
<span class="lineNum">      60 </span>            :           , remove_reference&lt;reference&gt;
<span class="lineNum">      61 </span>            :         &gt;::type cv_value_type;
<span class="lineNum">      62 </span>            : 
<span class="lineNum">      63 </span>            :      public:
<span class="lineNum">      64 </span>            :         typedef iterator_adaptor&lt;
<span class="lineNum">      65 </span>            :             transform_iterator&lt;UnaryFunc, Iterator, Reference, Value&gt;
<span class="lineNum">      66 </span>            :           , Iterator
<span class="lineNum">      67 </span>            :           , cv_value_type
<span class="lineNum">      68 </span>            :           , use_default    // Leave the traversal category alone
<span class="lineNum">      69 </span>            :           , reference
<span class="lineNum">      70 </span>            :         &gt; type;
<span class="lineNum">      71 </span>            :     };
<span class="lineNum">      72 </span>            :   }
<span class="lineNum">      73 </span>            : 
<span class="lineNum">      74 </span>            :   template &lt;class UnaryFunc, class Iterator, class Reference, class Value&gt;
<span class="lineNum">      75 </span><span class="lineCov">          8 :   class transform_iterator</span>
<span class="lineNum">      76 </span>            :     : public boost::iterators::detail::transform_iterator_base&lt;UnaryFunc, Iterator, Reference, Value&gt;::type
<span class="lineNum">      77 </span>            :   {
<span class="lineNum">      78 </span>            :     typedef typename
<span class="lineNum">      79 </span>            :     boost::iterators::detail::transform_iterator_base&lt;UnaryFunc, Iterator, Reference, Value&gt;::type
<span class="lineNum">      80 </span>            :     super_t;
<span class="lineNum">      81 </span>            : 
<span class="lineNum">      82 </span>            :     friend class iterator_core_access;
<span class="lineNum">      83 </span>            : 
<span class="lineNum">      84 </span>            :   public:
<span class="lineNum">      85 </span>            :     transform_iterator() { }
<span class="lineNum">      86 </span>            : 
<span class="lineNum">      87 </span>            :     transform_iterator(Iterator const&amp; x, UnaryFunc f)
<span class="lineNum">      88 </span>            :       : super_t(x), m_f(f) { }
<span class="lineNum">      89 </span>            : 
<span class="lineNum">      90 </span>            :     explicit transform_iterator(Iterator const&amp; x)
<span class="lineNum">      91 </span>            :       : super_t(x)
<span class="lineNum">      92 </span>            :     {
<span class="lineNum">      93 </span>            :         // Pro8 is a little too aggressive about instantiating the
<span class="lineNum">      94 </span>            :         // body of this function.
<span class="lineNum">      95 </span>            : #if !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
<span class="lineNum">      96 </span>            :         // don't provide this constructor if UnaryFunc is a
<span class="lineNum">      97 </span>            :         // function pointer type, since it will be 0.  Too dangerous.
<span class="lineNum">      98 </span>            :         BOOST_STATIC_ASSERT(is_class&lt;UnaryFunc&gt;::value);
<span class="lineNum">      99 </span>            : #endif
<span class="lineNum">     100 </span>            :     }
<span class="lineNum">     101 </span>            : 
<span class="lineNum">     102 </span>            :     template &lt;
<span class="lineNum">     103 </span>            :         class OtherUnaryFunction
<span class="lineNum">     104 </span>            :       , class OtherIterator
<span class="lineNum">     105 </span>            :       , class OtherReference
<span class="lineNum">     106 </span>            :       , class OtherValue&gt;
<span class="lineNum">     107 </span>            :     transform_iterator(
<span class="lineNum">     108 </span>            :          transform_iterator&lt;OtherUnaryFunction, OtherIterator, OtherReference, OtherValue&gt; const&amp; t
<span class="lineNum">     109 </span>            :        , typename enable_if_convertible&lt;OtherIterator, Iterator&gt;::type* = 0
<span class="lineNum">     110 </span>            : #if !BOOST_WORKAROUND(BOOST_MSVC, == 1310)
<span class="lineNum">     111 </span>            :        , typename enable_if_convertible&lt;OtherUnaryFunction, UnaryFunc&gt;::type* = 0
<span class="lineNum">     112 </span>            : #endif
<span class="lineNum">     113 </span>            :     )
<span class="lineNum">     114 </span>            :       : super_t(t.base()), m_f(t.functor())
<span class="lineNum">     115 </span>            :    {}
<span class="lineNum">     116 </span>            : 
<span class="lineNum">     117 </span>            :     UnaryFunc functor() const
<span class="lineNum">     118 </span>            :       { return m_f; }
<span class="lineNum">     119 </span>            : 
<span class="lineNum">     120 </span>            :   private:
<span class="lineNum">     121 </span>            :     typename super_t::reference dereference() const
<span class="lineNum">     122 </span>            :     { return m_f(*this-&gt;base()); }
<span class="lineNum">     123 </span>            : 
<span class="lineNum">     124 </span>            :     // Probably should be the initial base class so it can be
<span class="lineNum">     125 </span>            :     // optimized away via EBO if it is an empty class.
<span class="lineNum">     126 </span>            :     UnaryFunc m_f;
<span class="lineNum">     127 </span>            :   };
<span class="lineNum">     128 </span>            : 
<span class="lineNum">     129 </span>            :   template &lt;class UnaryFunc, class Iterator&gt;
<span class="lineNum">     130 </span>            :   inline transform_iterator&lt;UnaryFunc, Iterator&gt;
<span class="lineNum">     131 </span>            :   make_transform_iterator(Iterator it, UnaryFunc fun)
<span class="lineNum">     132 </span>            :   {
<span class="lineNum">     133 </span>            :       return transform_iterator&lt;UnaryFunc, Iterator&gt;(it, fun);
<span class="lineNum">     134 </span>            :   }
<span class="lineNum">     135 </span>            : 
<span class="lineNum">     136 </span>            :   // Version which allows explicit specification of the UnaryFunc
<span class="lineNum">     137 </span>            :   // type.
<span class="lineNum">     138 </span>            :   //
<span class="lineNum">     139 </span>            :   // This generator is not provided if UnaryFunc is a function
<span class="lineNum">     140 </span>            :   // pointer type, because it's too dangerous: the default-constructed
<span class="lineNum">     141 </span>            :   // function pointer in the iterator be 0, leading to a runtime
<span class="lineNum">     142 </span>            :   // crash.
<span class="lineNum">     143 </span>            :   template &lt;class UnaryFunc, class Iterator&gt;
<span class="lineNum">     144 </span>            :   inline typename iterators::enable_if&lt;
<span class="lineNum">     145 </span>            :       is_class&lt;UnaryFunc&gt;   // We should probably find a cheaper test than is_class&lt;&gt;
<span class="lineNum">     146 </span>            :     , transform_iterator&lt;UnaryFunc, Iterator&gt;
<span class="lineNum">     147 </span>            :   &gt;::type
<span class="lineNum">     148 </span>            :   make_transform_iterator(Iterator it)
<span class="lineNum">     149 </span>            :   {
<span class="lineNum">     150 </span>            :       return transform_iterator&lt;UnaryFunc, Iterator&gt;(it, UnaryFunc());
<span class="lineNum">     151 </span>            :   }
<span class="lineNum">     152 </span>            : 
<span class="lineNum">     153 </span>            : #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) &amp;&amp; !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
<span class="lineNum">     154 </span>            :   template &lt;class Return, class Argument, class Iterator&gt;
<span class="lineNum">     155 </span>            :   inline transform_iterator&lt; Return (*)(Argument), Iterator, Return&gt;
<span class="lineNum">     156 </span>            :   make_transform_iterator(Iterator it, Return (*fun)(Argument))
<span class="lineNum">     157 </span>            :   {
<span class="lineNum">     158 </span>            :     return transform_iterator&lt;Return (*)(Argument), Iterator, Return&gt;(it, fun);
<span class="lineNum">     159 </span>            :   }
<span class="lineNum">     160 </span>            : #endif
<span class="lineNum">     161 </span>            : 
<span class="lineNum">     162 </span>            : } // namespace iterators
<span class="lineNum">     163 </span>            : 
<span class="lineNum">     164 </span>            : using iterators::transform_iterator;
<span class="lineNum">     165 </span>            : using iterators::make_transform_iterator;
<span class="lineNum">     166 </span>            : 
<span class="lineNum">     167 </span>            : } // namespace boost
<span class="lineNum">     168 </span>            : 
<span class="lineNum">     169 </span>            : #include &lt;boost/iterator/detail/config_undef.hpp&gt;
<span class="lineNum">     170 </span>            : 
<span class="lineNum">     171 </span>            : #endif // BOOST_TRANSFORM_ITERATOR_23022003THW_HPP
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
